gtk3-demo: Show more button styles
authorMatthias Clasen <mclasen@redhat.com>
Sat, 26 Mar 2016 02:36:50 +0000 (22:36 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Sat, 26 Mar 2016 02:45:55 +0000 (22:45 -0400)
Add examples for suggested-action and destructive-action
buttons in the style classes example.

demos/gtk-demo/theming.ui
demos/gtk-demo/theming_style_classes.c

index 7455e6df40f0b284cd6e01643054745c9ccaefc0..617a2f723d048210cb94df60b1dd540ac7e26fb2 100644 (file)
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <interface>
   <object class="GtkGrid" id="grid">
-    <property name="row-spacing">6</property>
+    <property name="row-spacing">10</property>
     <property name="orientation">vertical</property>
     <child>
       <object class="GtkToolbar">
         </child>
       </object>
     </child>
+    <child>
+      <object class="GtkBox">
+        <property name="visible">1</property>
+        <property name="spacing">10</property>
+        <property name="orientation">horizontal</property>
+        <child>
+          <object class="GtkButton">
+            <property name="visible">1</property>
+            <property name="label">Plain</property>
+            <property name="halign">end</property>
+          </object>
+          <packing>
+            <property name="expand">1</property>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkButton">
+            <property name="visible">1</property>
+            <property name="label">Destructive</property>
+            <style>
+              <class name="destructive-action"/>
+            </style>
+          </object>
+        </child>
+        <child>
+          <object class="GtkButton">
+            <property name="visible">1</property>
+            <property name="label">Suggested</property>
+            <style>
+              <class name="suggested-action"/>
+            </style>
+          </object>
+        </child>
+      </object>
+    </child>
   </object>
 </interface>
index dcb1a908d516d23fdbd252139a816d5f8093eb81..63fea3ba34166a048f5aaa8f5d67f6c119f20b30 100644 (file)
@@ -24,6 +24,7 @@ do_theming_style_classes (GtkWidget *do_widget)
       gtk_window_set_screen (GTK_WINDOW (window),
                              gtk_widget_get_screen (do_widget));
       gtk_window_set_title (GTK_WINDOW (window), "Style Classes");
+      gtk_window_set_resizable (GTK_WINDOW (window), FALSE);
       gtk_container_set_border_width (GTK_CONTAINER (window), 12);
       g_signal_connect (window, "destroy",
                         G_CALLBACK (gtk_widget_destroyed), &window);